<template>
  <div class="content-wrap">
    <div class="business-info-mod">
      <el-form @submit.native.prevent  ref="shopSetForm" :model="shopSetList" label-width="140px" size="small">
        <div class="ci-wrapper">
          <div class="left-info">
            <!-- 门店自定义装修 -->
            <el-form-item :label="$t('shopProcess.customRenovation')" prop="customRenovation">
              <p class="txt">
                <el-radio disabled v-model="shopSetList.customRenovation" label="1">{{$t('shopProcess.start')}}</el-radio>
                <el-radio disabled v-model="shopSetList.customRenovation" label="0">{{$t('shopProcess.close')}}</el-radio>
              </p>
              <div class="tips">{{$t('shopProcess.permissionTxt1')}}</div>
            </el-form-item>
            <!-- 门店自定义运费 -->
            <el-form-item :label="$t('shopProcess.customFreightAmount')" prop="customFreightAmount">
              <p class="txt">
                <el-radio disabled v-model="shopSetList.customFreightAmount" label="1">{{$t('shopProcess.start')}}</el-radio>
                <el-radio disabled v-model="shopSetList.customFreightAmount" label="0">{{$t('shopProcess.close')}}</el-radio>
              </p>
              <div class="tips">{{$t('shopProcess.permissionTxt2')}}</div>
            </el-form-item>
            <!-- 门店自建营销活动 -->
            <el-form-item :label="$t('shopProcess.customSales')" prop="customSales">
            <p class="txt">
              <el-radio disabled v-model="shopSetList.customSales" label="1">{{$t('shopProcess.start')}}</el-radio>
              <el-radio disabled v-model="shopSetList.customSales" label="0">{{$t('shopProcess.close')}}</el-radio>
            </p>
            <div class="tips">{{$t('shopProcess.permissionTxt3')}}</div>
            </el-form-item>
            <!-- 门店自行管理商品 -->
            <el-form-item :label="$t('shopProcess.customProd')" prop="customProd">
            <p class="txt">
              <el-radio disabled v-model="shopSetList.customProd" label="1">{{$t('shopProcess.start')}}</el-radio>
              <el-radio disabled v-model="shopSetList.customProd" label="0">{{$t('shopProcess.close')}}</el-radio>
            </p>
            <div class="tips">{{$t('shopProcess.permissionTxt4')}}</div>
            </el-form-item>
          </div>
        </div>
      </el-form>
    </div>

    <!-- 权限设置 -->
    <div class="foot-btn">
      <el-button type="infor" size="small" @click="preStep">{{$t('shopProcess.previousStep')}}</el-button>
      <el-button type="primary" size="small" @click="submitComplete">{{$t('brand.createShop')}}</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      brandId: '',
      shopSetList: {
        customRenovation: '1',
        customFreightAmount: '1',
        customSales: '1',
        customProd: '1'
      }
    }
  },

  mounted () {},

  methods: {
    // 获取承租商的默认权限
    getBrandPermissions () {
      this.brandId = sessionStorage.getItem('selectedBrandId')
      if (!this.brandId) return
      this.$http({
        url: this.$http.adornUrl(`/brand/brandConfig`),
        method: 'get',
        params: this.$http.adornParams({
          brandId: this.brandId
        })
      }).then(({ data }) => {
        if (!data) return
        this.shopSetList.customRenovation = data.customRenovation.toString()
        this.shopSetList.customFreightAmount = data.customFreightAmount.toString()
        this.shopSetList.customSales = data.customSales.toString()
        this.shopSetList.customProd = data.customProd.toString()
      })
    },
     // 上一步
    preStep () {
      this.$emit('preStep')
    },
     // 提交
    submitComplete () {
      // console.log('权限', this.shopSetList)
      this.$emit('submitComplete', this.shopSetList)
    }
  }
}
</script>

<style lang="scss" scoped>
.content-wrap {
  margin-top: 20px;
  & >>> .el-form {
    display: block;
    width: 100%;
    padding: 0 10px;
    .el-form-item {
      margin-bottom: 30px;
    }
  }
  .ci-wrapper {
    display: flex;
    justify-content: flex-start;
    .left-info {
      .txt {
        width: 100%;
        margin: 0;
      }
      .tips {
        width: 100vw;
        color: #999;
      }
    }
    .capital-int {
      & >>> .el-input__inner {
        padding-right: 0!important;
        border-radius: 2px 0 0 2px!important;
      }
    }
  }
  .foot-btn {
    margin: 30px 140px;
  }
}
</style>
